package util;



//@Component
public class ConfigConstant {
	/*用户上传文件的存放目录：配置文件注入*/
	public static String fileStoreRootPath;

	/*文件上传最大值：配置文件注入*/
	public static Long fileMaxSize;
	
	/*报告扩展名：配置文件注入*/
	public static String reportFileExt;
	
	/*报告扩展名：配置文件注入*/
	public static String paperFileExt;
	
	public static void setPaperFileExt(String paperFileExt) {
		ConfigConstant.paperFileExt = paperFileExt;
	}


	/*开题报告子目录*/
	public static final String REPORT_SAVE_PATH = "/topic/report/";
	/*开题报告子目录*/
	public static final String PAPER_SAVE_PATH = "/topic/paper/";
	/*开题报告统一磁盘文件名*/
	public static final String REPORT_FILE_NAME = "开题报告";
	/*论文统一磁盘文件名*/
	public static final String PAPER_FILE_NAME = "学生论文";

	public static Long getFileMaxSize() {
        return fileMaxSize;
    }
	
	public static String getFileMaxSizeText() {
		return getFileMaxSizeText(fileMaxSize);
	}
	
	public static String getFileMaxSizeText(Long size) {
		return (size/1_000_000)+"MB";
	}

    public static void setFileMaxSize(Long fileMaxSize) {
        ConfigConstant.fileMaxSize = fileMaxSize;
    }

    public static String getFileStoreRootPath() {
		return fileStoreRootPath;
	}

	public static void setFileStoreRootPath(String fileStorePath) {
		ConfigConstant.fileStoreRootPath = fileStorePath+"/paper-system/";
	}
	
//	public static String getReportFileExt() {
//		return reportFileExt;
//	}

	public static void setReportFileExt(String reportFileExt) {
		ConfigConstant.reportFileExt = reportFileExt;
	}

	
	public static void main(String[] args) {
		System.out.println(getFileMaxSizeText());
	}
}
